# -*- coding:utf-8 -*-

import os
import yaml

cfg_path = os.path.realpath(os.path.dirname(__file__)) + "/cfg.yml"

cfg = {}

try:
    with open(cfg_path, 'r') as f:
        cfg = yaml.load(f)
except:
    pass

class conf:

    class mysql:
        host, port, user, password, db, charset = cfg.get("mysql", ("127.0.0.1", 3306, "root", "123456", "exchange", "utf8mb4"))


    class redis:
        host, port, db = cfg.get("redis", ("localhost", 6379, 0))


    class mongodb:
        host, port = cfg.get("mongodb", ("localhost", 27017))


    class flask:
        host, port = cfg.get("flask", ("0.0.0.0", 5000))


    class round:
        size = cfg.get("size", (6))
